/**
 * 
 */
package com.thor.palmmall.rest.sales.input.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.sales.input.ASalesInputLine;
import com.thor.palmmall.spi.sales.input.SSalesInputLine;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SSalesInputLineConverter implements Converter<ASalesInputLine, SSalesInputLine> {

  public static SSalesInputLineConverter getInstance() {
    if (instance == null)
      instance = new SSalesInputLineConverter();
    return instance;
  }

  private static SSalesInputLineConverter instance;

  private SSalesInputLineConverter() {
  }

  @Override
  public SSalesInputLine convert(ASalesInputLine source) {
    if (source == null) {
      return null;
    }
    SSalesInputLine target = new SSalesInputLine();
    target.setPayment(source.getPayment());
    target.setTotal(source.getTotal());
    return target;
  }

}
